Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TestFailure] Resolving exceptions thrown across multiple GraphBolt tests. #7852

Merged
merged 7 commits into from
Jan 8, 2025

Conversation

drivanov
Copy link
Contributor

@drivanov drivanov commented Jan 6, 2025

Description

This PR resolves the following exceptions appearing in multiple GraphBolt tests after merging of Pytorch PR#137602 (Flip default on weights_only):

if weights_only:
    try:
         return _load(
                  opened_zipfile,
                  map_location,
                  _weights_only_unpickler,
                  overall_storage=overall_storage,
                  **pickle_load_args,
              )
except pickle.UnpicklingError as e:
>   raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
E    pickle.UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, 
[do those steps only if you trust the source of the checkpoint]. 
E    (1) Re-running `torch.load` with `weights_only` set to `False` will likely succeed, but it can result in arbitrary 
code execution. Do it only if you got the file from a trusted source.
E    (2) Alternatively, to load with `weights_only=True` please check the recommended steps in the following 
error message.
E    WeightsUnpickler error: Unsupported global: GLOBAL dgl.graphbolt.impl.fused_csc_sampling_graph.FusedCSCSamplingGraph 
was not an allowed global by default.  Please use `torch.serialization.add_safe_globals([FusedCSCSamplingGraph])` 
or the `torch.serialization.safe_globals([FusedCSCSamplingGraph])` context manager to allow list this global if you 
trust this class/function.
E                           
E    Check the documentation of torch.load to learn more about types accepted by default with 
weights_only https://pytorch.org/docs/stable/generated/torch.load.html.

/usr/local/lib/python3.12/dist-packages/torch/serialization.py:1455: UnpicklingError

Checklist

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [$CATEGORY] (such as [NN], [Model], [Doc], [Feature]])
  • I've leverage the tools to beautify the python and c++ code.
  • The PR is complete and small, read the Google eng practice (CL equals to PR) to understand more about small PR. In DGL, we consider PRs with less than 200 lines of core code change are small (example, test and documentation could be exempted).
  • To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

@chang-l
Copy link
Collaborator

chang-l commented Jan 6, 2025

Thank you @drivanov. Can you also add weights_only=False to other places within python/dgl, like here and here?

@chang-l chang-l requested a review from mfbalin January 6, 2025 18:16
@chang-l chang-l requested a review from classicsong January 6, 2025 18:17
@drivanov
Copy link
Contributor Author

drivanov commented Jan 6, 2025

@chang-l : In addition to the ones I’ve already fixed and the two you mentioned, there are 14 more similar torch.load calls (refer to the attached file). Would you like me to address all of them in this PR, or would that be too much for a single submission?
Screenshot from 2025-01-06 11-02-32

@chang-l
Copy link
Collaborator

chang-l commented Jan 6, 2025

Would you like me to address all of them in this PR, or would that be too much for a single submission? !

I think it is fine to address them all in this PR. Also, would you mind to refer this PyTorch PR: pytorch/pytorch#137602 in your PR description?

@Rhett-Ying
Copy link
Collaborator

fix the lint please

@Rhett-Ying Rhett-Ying self-requested a review January 7, 2025 00:17
@Rhett-Ying
Copy link
Collaborator

please run the tests in your local manually.

@chang-l
Copy link
Collaborator

chang-l commented Jan 8, 2025

@Rhett-Ying This PR passed our CI.

@Rhett-Ying
Copy link
Collaborator

@drivanov uni tests in DGL can pass as well? If so, we could merge it @chang-l

Copy link
Collaborator

@chang-l chang-l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rhett-Ying Yes, all unit tests are passed.

@Rhett-Ying Rhett-Ying merged commit 540dd2b into dmlc:master Jan 8, 2025
1 of 2 checks passed
@drivanov drivanov deleted the weights_only branch January 8, 2025 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants